package com.st.buy.sso.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.ws.rs.Path;

/**
 * @author 张双虎
 */
@Controller
public class PageController {
    @RequestMapping("/{page}")
    public String showPage(@PathVariable String page){
        return page;
    }
    //进入登录页面之前，传入参数redirect 回调的url，如果没有就直接使用空字符串
    @RequestMapping("/login")
    public String inputLogin(@RequestParam(defaultValue = "") String redirect, Model model){
        model.addAttribute("redirect",redirect);
        return "login";
    }
}
